﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gerador_numero_contrato.aspx.cs" Inherits="gerador_numero_contrato" %>

<body style="background-color: White;">
    <center>
        <div style="margin: width: 300px;">
            <br />
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
            <%
                System.Threading.Thread.Sleep(1000);
                DateTime date = DateTime.Now;
                string month = "" + date.Month;
                if (month.Length == 1)
                {
                    month = "0" + month;
                }
                string day = "" + date.Day;
                if (day.Length == 1)
                {
                    day = "0" + day;
                }
                            
                string hour = "" + date.Hour;
                if (hour.Length == 1)
                {
                    hour = "0" + hour;
                }
                string minute = "" + date.Minute;
                if (minute.Length == 1)
                {
                    minute = "0" + minute;
                }
                string second = "" + date.Second;
                if (second.Length == 1)
                {
                    second = "0" + second;
                }  
                                                                                                                                          
                string number = ("" + date.Year + "" + month + day + hour + minute + second);
                double dNumber = double.Parse(number);
            %>
            <%= dNumber.ToString("#,##0") %>
            <br />
            <input type="button" value="Copiar número e fechar" onclick="parent.setContractNumber('<%= dNumber.ToString("#,##0") %>'); parent.Shadowbox.close();" />
            <input id="generateButton" type="button" value="Gerar outro número" onclick="generateButton.disabled = true; window.location = window.location;" />            
            <br />
        </div>
    </center>
</body>